//
//  AnnouncerMoreCell.m
//  MountEverestFM
//
//  Created by ChenNing on 15/11/7.
//  Copyright © 2015年 chenn. All rights reserved.
//

#import "AnnouncerMoreTableViewCell.h"

@interface AnnouncerMoreTableViewCell()
// 头像
@property(nonatomic,strong)UIImageView *headerImageView;
// 昵称
@property(nonatomic,strong)UILabel *nickNameLabel;
// 内容
@property(nonatomic,strong)UILabel *contentLabel;
// 专辑图标
@property(nonatomic,strong)UIImageView *specialImageView;
// 专辑数量
@property(nonatomic,strong)UILabel *specialCountLabel;

// 试听
@property(nonatomic,strong)UILabel *tryListenLabel;
@end

@implementation AnnouncerMoreTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.headerImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_headerImageView];
        self.nickNameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nickNameLabel];
        self.contentLabel = [[UILabel alloc] init];
        self.contentLabel.font = [UIFont systemFontOfSize:15];
        self.contentLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:_contentLabel];
        self.specialImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_specialImageView];
        self.specialCountLabel = [[UILabel alloc] init];
        self.specialCountLabel.font = [UIFont systemFontOfSize:15];
        self.specialCountLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:_specialCountLabel];
        self.tryListenButton = [[UIButton alloc] init];
        [self.contentView addSubview:_tryListenButton];
        self.tryListenLabel = [[UILabel alloc] init];
        self.tryListenLabel.font = [UIFont systemFontOfSize:15];
        self.tryListenLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:_tryListenLabel];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.headerImageView.frame = CGRectMake(FM_Screen_Pts_Width*10, FM_Screen_Pts_Width*10, FM_Screen_Pts_Width*130, FM_Screen_Pts_Width*130);
    self.nickNameLabel.frame = CGRectMake(FM_Screen_Pts_Width*150,  FM_Screen_Pts_Width*10, FM_Screen_Width-FM_Screen_Pts_Width*160, FM_Screen_Pts_Height*20);
    self.contentLabel.frame = CGRectMake(FM_Screen_Pts_Width*150,  FM_Screen_Pts_Width*45, FM_Screen_Width-FM_Screen_Pts_Width*160, FM_Screen_Pts_Height*20);
    self.specialImageView.frame = CGRectMake(FM_Screen_Pts_Width*150, FM_Screen_Pts_Width*80, FM_Screen_Pts_Width*20, FM_Screen_Pts_Width*20);
    self.specialCountLabel.frame = CGRectMake(FM_Screen_Pts_Width*175, FM_Screen_Pts_Width*80, FM_Screen_Pts_Width*50, FM_Screen_Pts_Width*20);
    self.tryListenButton.frame = CGRectMake(FM_Screen_Pts_Width*150, FM_Screen_Pts_Width*110, FM_Screen_Pts_Width*30, FM_Screen_Pts_Width*30);
    self.tryListenLabel.frame = CGRectMake(FM_Screen_Pts_Width*195, FM_Screen_Pts_Width*110, FM_Screen_Pts_Width*50, FM_Screen_Pts_Width*30);
}

- (void)setAnnMoreDic:(NSDictionary *)annMoreDic
{
    if (_annMoreDic != annMoreDic) {
        _annMoreDic = annMoreDic;
    }
    [self setAnnMoreInfo:annMoreDic];
}
- (void)setAnnMoreInfo:(NSDictionary *) annMoreDic
{
    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:[annMoreDic objectForKey:@"middleLogo"]] placeholderImage:[UIImage imageNamed:@"find_kind_btn_default@3x.png"]];
    self.nickNameLabel.text = [annMoreDic objectForKey:@"nickname"];
    self.contentLabel.text = [annMoreDic objectForKey:@"personDescribe"];
    self.specialImageView.image = [UIImage imageNamed:@"album_tracks@3x.png"];
    self.specialCountLabel.text = [[annMoreDic objectForKey:@"tracksCounts"] stringValue];
    

    [self.tryListenButton setBackgroundImage:[UIImage imageNamed:@"sound_playbtn@2x.png"] forState:UIControlStateNormal];

    
    
    self.tryListenLabel.text = @"试听";
}


@end
